package com.yu.newsSys.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

//@Mapper 其实已经被xml文件中配置的扫描到了
public interface AdminDao {
    @Select("select count(id) from admin where username = #{username}")
    int countByUserName(String username);
    @Insert("insert into admin(username, password) VALUES (#{username},#{password})")
    int save(@Param("username") String username, @Param("password") String password);
    @Select("select count(id) from admin where username = #{username} and password = #{password}")
    int checkUser(@Param("username") String username, @Param("password")String password);
}
